<template>
  <div>
    <h1>Test</h1>

    <!--    <baidu-map class="bm-view" :center="center" :zoom="zoom">-->
    <!--    </baidu-map>-->

    <div id="he-plugin-standard"></div>
  </div>
</template>

<script>
export default {
  name: "Page1",

  data() {
    return {

      center: '四川外国语大学',
      // center: {
      //   lng: 106.611,
      //   lat: 29.535
      // },
      zoom: 18,
    }
  },

  created() {
    window.WIDGET = {
      "CONFIG": {
        "layout": "1",
        "width": "450",
        "height": "150",
        "background": "2",
        "dataColor": "666666",
        "borderRadius": "5",
        "key": "49710d3f6b1b4d4490347dc45dd0179d"
      }

    };
    (function (d) {
      var c = d.createElement('link')
      c.rel = 'stylesheet'
      c.href = 'https://widget.qweather.net/standard/static/css/he-standard.css?v=2.0'
      var s = d.createElement('script')
      s.src = 'https://widget.qweather.net/standard/static/js/he-standard-common.js?v=2.0"'
      var sn = d.getElementsByTagName('script')[0]
      sn.parentNode.insertBefore(c, sn)
      sn.parentNode.insertBefore(s, sn)
      s.onload = () => {
        //自动宽度
        setTimeout(() => {
          document.getElementById("he-plugin-standard").style.width = "100%";

        }, 100);
      }
    })(document)

  }
}
</script>

<style scoped>
.bm-view {
  width: 100%;
  height: 300px;
}
</style>
